package javaRunnalb;

public class PingPong implements Runnable {
	private int delay;
	private String message;
	
	public PingPong(String m, int r){
		message = m;
		delay = r;
	}
	
	public void run(){
		try{
			for(int i=0; i<3; i++){
				System.out.println(message);
				Thread.sleep(delay);
			}
		}catch(InterruptedException e){
			return;
		}
	}
	public static void main(String[] args) {
		PingPong pp1 = new PingPong("pop",1000);
		PingPong pp2 = new PingPong("&",1000);
		PingPong pp3 = new PingPong("pipi",1000);
		Thread t1 = new Thread(pp1);
		Thread t2 = new Thread(pp2);
		Thread t3 = new Thread(pp3);
		t1.start();
		t2.start();
		t3.start();
	}

}
